package 设计模式.singleton;

/**
 * @功能
 * @创建时间 2020/5/3
 */
public class Single {
    private static volatile Single single ;

    private Single() {

    }

    public static Single create() {
        if (single == null)
            synchronized (Single.class) {
                if (single == null)
                    single = new Single();
                return single;
            }
        return single;
    }


}
class ww{
    public static void main(String[] args) {
        Single singleton = Single.create();
    }
}
